#include <iostream> 
#include <cmath>
using namespace std;
class point{
public:
	point(int xx=0,int yy=0):x(xx),y(yy){}
	point(point &p);
	~point(){cout<<"the point is eliminated"<<endl;}
	int getx(){return x;}
	int gety(){return y;}
private:
	int x,y;
};
point::point(point &p){
	x=p.x;
	y=p.y;
	cout<<"calling the copy constructor of point"<<endl;
}
void dist1(point p1,point p2){
	double x=static_cast<double>(p1.getx()-p2.getx());
	double y=static_cast<double>(p1.gety()-p2.gety());
	double len=sqrt(x*x+y*y);
	cout<<"this is dist1,the length is:"<<len<<endl;
}
void dist2(point &p1,point &p2){
	double x=static_cast<double>(p1.getx()-p2.getx());
	double y=static_cast<double>(p1.gety()-p2.gety());
	double len=sqrt(x*x+y*y);
	cout<<"this is dist2,the length is:"<<len<<endl;
}
int main(){
	point myp1(1,1),myp2(4,5);
	dist1(myp1,myp2);
	dist2(myp1,myp2);
	return 0;
}
